package com.yztc.youbadbad.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.yztc.youbadbad.R;
import com.yztc.youbadbad.bean.homepage.Other2Bean;
import com.yztc.youbadbad.helper.BaseAdapterHelper;

import java.util.List;

/**
 * 二级分类gridview 的适配器
 * Created by Tiffany.V.Chou on 2016/11/17.
 */

public class Other2GridViewAdapter extends BaseAdapterHelper<Other2Bean> {

    public Other2GridViewAdapter(Context context, List<Other2Bean> list) {
        super(context, list);
    }

    @Override
    public View getItemView(int position, View convertView, ViewGroup parent) {

        convertView = mInflater.inflate(R.layout.item_other_gridview, null);
        ImageView iv = (ImageView) convertView.findViewById(R.id.gd_iv);
        TextView tv = (TextView) convertView.findViewById(R.id.gd_tv);
        Other2Bean bean = mList.get(position);
        tv.setText(bean.getCategoryName());

        Glide.with(mContext).load(bean.getCategoryPic()).thumbnail(0.1f).into(iv);
        return convertView;
    }
}
